#include <iostream>
#include <vector>

using namespace std;

class Solution
{
public:
    void moveZeroes(vector<int> &nums)
    {
        int lastIndex = 0;
        for (int i = 0; i < nums.size(); i++)
        {
            if (nums[i] != 0)
            {
                if (lastIndex != i)
                    swap(nums[i], nums[lastIndex]);
                lastIndex++;
            }
        }
        for (int i = lastIndex; i < nums.size(); i++)
        {
            nums[i] = 0;
        }
    }
};

int main()
{
    cout << "Code283" << endl;
    Solution s;
    vector<int> nums = {0, 1, 0, 3, 12};
    s.moveZeroes(nums);
    for (int i = 0; i < nums.size(); i++)
    {
        cout << nums[i] << " ";
    }
    return 0;
}